GBML manual / Cutscenes

dialogue_start

Plays one dialogue by its name (made with New dialogue in the Dialogue section of the Cutscenes tab). Any character, object or trigger can start it. Write the dialogue's name in quotes, exactly as the Dialogue list spells it.

Syntax

dialogue_start(who)

Arguments

NameType
whostring

Returns

Nothing.

Description

Plays one dialogue by its name: the dialogues you make with New dialogue in the Dialogue section of the Cutscenes tab. A dialogue stands on its own, so any character, object or trigger can start it. Write the dialogue's name in quotes, spelled as the Dialogue list spells it.

A dialogue is an ordinary cutscene that the Dialogue designer writes, so it plays exactly like one: gameplay stands still while it runs, and nothing starts if a scene is already playing. Who speaks each line is decided inside the dialogue (each Line picks a character from the Characters list, or uses the dialogue's Default character).

To pick between several dialogues ("Quest done" when quest_stage is 3, "Waiting" when it is at least 1, "Hello" otherwise), use the Behaviors action "Talk when someone is close and presses a button": it holds an ordered list of dialogues with a condition for each, and the first one that holds plays. In code the same choice is an ordinary if. The action \

Talking when the player presses a button

Put the call where the player asks for it, such as a Step event that waits for the button (the Behaviors action "Talk when someone is close and presses a button" writes this with a distance test too):

if (btn_pressed(BTN_A)) {
    dialogue_start("guard_hello");
}

Example

dialogue_start("guard_hello");

Plays the dialogue "guard_hello".

Older games

A game made when a character held its own list of conversations keeps working: dialogue_start("guard") with a character's name plays that character's old list, which Gbabel moved into a small script when it opened the game.

On the GBA

One scene plays at a time, project-wide - see docs/CUTSCENES_BLUEPRINT.md section 6.3 for what happens if you call cutscene_start while one is already running, and section 6.2 for how the camera is automatically handed back to whatever it was following (or not) once a scene ends. While a scene plays, ordinary Step/Alarm/Button/Movement/Collision dispatch is frozen project-wide - Draw, the camera, audio, tile animation and particles all keep running exactly as they already do during a room transition (section 6.1). A dialogue is an ordinary cutscene the Dialogue designer wrote, so it plays the same way and starts nothing if a scene is already playing.

See also: cutscene_startcutscene_activecutscene_stop